package com.slz3.business.module.systemManagement.sysMenu.steward;

import com.slz3.business.module.systemManagement.sysMenu.domain.SysMenu;
import com.slz3.business.module.systemManagement.sysMenu.domain.SysMenuCondition;
import org.springframework.stereotype.Component;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

import javax.annotation.Resource;

@Component
public class SysMenuResponse {

    @Resource
    private SysMenuResController sysMenuResController;
    
    public Mono<ServerResponse> add(ServerRequest req) {
        return req.bodyToMono(SysMenu.class).flatMap(sysMenu ->
                sysMenuResController.add(req, sysMenu)
        );
    }

    public Mono<ServerResponse> delete(ServerRequest req) {
        return req.bodyToMono(SysMenuCondition.class).flatMap(sysMenuCondition ->
                sysMenuResController.delete(req, sysMenuCondition)
        );
    }

    public Mono<ServerResponse> modify(ServerRequest req) {
        return req.bodyToMono(SysMenu.class).flatMap(sysMenu ->
                sysMenuResController.modify(req, sysMenu)
        );
    }


    public Mono<ServerResponse> list(ServerRequest req) {
        return sysMenuResController.list(req);
    }

    public Mono<ServerResponse> info(ServerRequest req) {
        return sysMenuResController.info(req);
    }

    public Mono<ServerResponse> choice(ServerRequest req) {
        return sysMenuResController.choice(req);
    }

    public Mono<ServerResponse> auditSubmit(ServerRequest req) {
        return req.bodyToMono(SysMenuCondition.class).flatMap(sysMenuCondition ->
                sysMenuResController.auditSubmit(req, sysMenuCondition)
        );
    }

    public Mono<ServerResponse> audit(ServerRequest req) {
        return req.bodyToMono(SysMenuCondition.class).flatMap(sysMenuCondition ->
                sysMenuResController.audit(req, sysMenuCondition)
        );
    }

    public Mono<ServerResponse> auditReject(ServerRequest req) {
        return req.bodyToMono(SysMenuCondition.class).flatMap(sysMenuCondition ->
                sysMenuResController.auditReject(req, sysMenuCondition)
        );
    }

    public Mono<ServerResponse> usingEnable(ServerRequest req) {
        return req.bodyToMono(SysMenuCondition.class).flatMap(sysMenuCondition ->
                sysMenuResController.usingEnable(req, sysMenuCondition)
        );
    }

    public Mono<ServerResponse> usingDisable(ServerRequest req) {
        return req.bodyToMono(SysMenuCondition.class).flatMap(sysMenuCondition ->
                sysMenuResController.usingDisable(req, sysMenuCondition)
        );
    }

    public Mono<ServerResponse> listAllMenu(ServerRequest req) {
        return sysMenuResController.listAllMenu(req);
    }

    public Mono<ServerResponse> listMenuByLogin(ServerRequest req) {
        return sysMenuResController.listMenuByLogin(req);
    }
}
